#!/usr/bin/python

import pickle
t = {"first":[1,2,3], "second":('x','y','z'), 3:{'one':9000, 'two':100500}, 555:{1,3,5,7}}
print "Source object"
print t
dt = pickle.dumps(t)
print "Pickled object"
print repr(dt)
t2 = pickle.loads(dt)
print "Unpickled object"
print t2

r = [1,2,3]
r.append(r)
r += [4,5,6]
print "Recursive object"
print r
dr = pickle.dumps(r)
print "Pickled:"
print repr(dr)
r2 = pickle.loads(dr)
print "Unpickled:"
print r2
